$(document).ready(function() {
    $("#submit").click(function() {
        var username = $("#name").val();
        var password = $("#password").val();
        $.ajax({
            url: 'php/interface.php?method=login',
            method: 'post',
            dataType: 'json',
            data: {
                username: username,
                password: password
            }
        }).done(function(data) {
            if (data.result === true) {
				location.href = 'admin/check.php';
            } else {
                alert(data.msg);
            }
        });
    });
});
